package com.xiaoxiao.springbootstudy.service.impl;

//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xiaoxiao.springbootstudy.pojo.ScalJh;
import com.xiaoxiao.springbootstudy.service.ScalJhService;
import com.xiaoxiao.springbootstudy.mapper.ScalJhMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author XiaoXiao
* @description 针对表【t_scal_jh】的数据库操作Service实现
* @createDate 2025-05-13 14:45:56
*/
@Service
public class ScalJhServiceImpl extends ServiceImpl<ScalJhMapper, ScalJh>
    implements ScalJhService{

    @Autowired
    private ScalJhMapper scalJhMapper;

    @Override
    public Map<String, Object> getSellList(Integer pageNum, Integer pageSize) {
        Map<String, Object> map = new HashMap<String, Object>();
        Page<Object> page =  PageHelper.startPage(pageNum, pageSize);
//        Page<ScalJh> page = new Page(pageNum, pageSize);
//        List list = this.list(page);
        List list = scalJhMapper.querySellJhListMapper();
        map.put("total", page.getTotal());
        map.put("rows", list);

        return map;
    }
}




